﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using Aandelendelen.Payment;
using Aandelendelen.Db;
using NLog;

namespace Aandelendelen
{
	public partial class IdealCheckHandler : System.Web.UI.Page
	{
		private static Logger logger = LogManager.GetCurrentClassLogger();

		protected void Page_Load(object sender, EventArgs e)
		{
			logger.Info("Checkhandler: Handling TargetPay micropayment...");

			string transactionId = this.Request["trxid"]; //targetpay

			try
			{
				IdealTargetPayHandler idealHandler = new IdealTargetPayHandler(transactionId, true);

				idealHandler.Handle();
			}
			catch (Exception ex)
			{
				logger.ErrorException("Error handling iDEAL:", ex);

				return;
			}
		}
	}
}